package com.zyh.work2

object Vehicle{
  def main(args: Array[String]): Unit = {
    val vehicle:Vehicle = new Vehicle("宝马","白色")
    vehicle.move()
    vehicle.showInfo()
    println(s"vehicle = ${vehicle}")
  }
}
case class Vehicle(){
  var brand: String = _
  var color: String = _
  def this(brand:String,color:String) = {
    this
    this.brand=brand
    this.color=color
  }
  def move(): Unit = println("我已启动")
  def showInfo(): Unit = println(s"商标 = $brand，颜色 = $color")
}
